public class ExtendsTest {

    public static void test(Father father) {
        father.setAge(12);
        father.setName("老毛狗屎");
    }
    public static void testObjectArr(Father[] fathers){
        fathers[0].setName("老毛狗屎");
        fathers[0].setAge(12);
    }
    public static void testBaseType(int a){
        a=12;
    }
    public static void testPackType(Integer a){
        a=24;
    }

    public static void testFinalType(B b){
        b.setA(12);
    }

    public static void main(String[] args) {
        B b=new B(23);
        testFinalType(b);
        System.out.println(b.getA());
    }
}

final class B{
    private Integer a;
    public B(int av){
        a=av;
    }

    public Integer getA() {
        return a;
    }

    public void setA(Integer a) {
        this.a = a;
    }
}

class Father{
    private String name;
    private int age;

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    public void say(){
        System.out.println("爸爸说你好");
    }
}
final class Son extends Father{
    public void say(){
        System.out.println("儿子说你好");
    }
}